package com.storage.utill;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class DateUtil {
    /**
     * 得到当前日期目录
     *
     * @return 返回当前日期字符串 2025/5/12
     */
    public static String getCurrentDateDir() {
        return getFormatTime("yyyy/MM/dd");
    }

    public static String getCurrentDateStr() {
        return getFormatTime("yyyyMMdd");
    }

    public static String getFormatTime(String datePattern) {
        return LocalDate.now().format(DateTimeFormatter.ofPattern(datePattern));
    }
}
